package com.xian.scala.stream

import org.apache.flink.streaming.api.scala.{DataStream, StreamExecutionEnvironment}

/**
 * 获取 socket 流数据
 */
object GetSocketData {
  def main(args: Array[String]): Unit = {
    val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment

    env.setParallelism(1)

    val dataStream: DataStream[String] = env.socketTextStream("r71", 2323)

    dataStream.print()


    env.execute()
  }
}
